Thumb

Comparison Operator

9/14/2020 7:02:15 AM

Comparison Operator: The comparison operator used to compare two or more value of the SQL table columns values. Equal (=), Greater than (>), Less than (<), Greater than or equal (>=), Less than or equal (<=), Not equal to (<>). Generally, this operator returns the true or false value. Now given bellow the example code: 

SELECT * FROM Salary WHERE Salary = 18000;

SELECT * FROM Salary WHERE Salary > 18000;

SELECT * FROM Salary WHERE Salary < 18000;

SELECT * FROM Salary WHERE Salary >= 18000;

SELECT * FROM Salary WHERE Salary <= 18000;

SELECT * FROM Salary WHERE Salary <> 18000;

In this case we have Salary table then we have salary column, select the column value by the comparison operators.